package com.hudson.plugin.server.hibernateDB.domain.dao;

import com.hudson.plugin.server.hibernateDB.internal.domain.entity.PromotionsEntity;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Richard
 * Date: 5/29/11
 * Time: 10:42 PM
 * To change this template use File | Settings | File Templates.
 */
public interface PromotionsDAOInterface {
    // property constants
    String NAME = "name";

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    void save(PromotionsEntity transientInstance);

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    void delete(PromotionsEntity persistentInstance);

    PromotionsEntity findById(Integer id);

    List findByProperty(String propertyName, Object value);

    List findByName(Object name);

    List findAll();

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    PromotionsEntity merge(PromotionsEntity detachedInstance);

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    void attachDirty(PromotionsEntity instance);

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    void attachClean(PromotionsEntity instance);
}
